package com.xingkeduo.dto.param;

import com.xingkeduo.pojo.enums.CommentStar;
import com.xingkeduo.utils.TableAnnotations;
import lombok.Data;

import javax.validation.constraints.NotBlank;


/**
 * 评论添加参数
 */
@Data
public class CommentInitDto {



    private String orderNo;

//    @NotNull(message = "服务评分不能为空")
    private CommentStar commentStar;

    @NotBlank(message = "评价标签不能为空")
    private String judgementLabel;

    @NotBlank(message = "评价内容不能为空")
    private String commentNotFilter;

    private String picIds;

    private Boolean anonymous;

    @TableAnnotations("评价（已过滤）")
    private String comment;

    @TableAnnotations("评价标签（用逗号分开；例如：1，2，3，4，5）")
    private String labels;

    public void covert(CommentSubmitParameterDto commentNotFilter,String labels){
        this.orderNo = commentNotFilter.getOrder_no();
        this.commentStar = CommentStar.getEnum(commentNotFilter.getStar());
        this.judgementLabel = commentNotFilter.getTag_selected();
        this.commentNotFilter = commentNotFilter.getComment();
        this.anonymous = commentNotFilter.getAnonymous();
        this.picIds=commentNotFilter.getPic_ids();
        this.labels = labels;
    }


}
